//
//  CustomTextField.m
//  duomi
//
//  Created by xiebin on 14-10-20.
//  Copyright (c) 2014年 xiebin. All rights reserved.
//

#import "CustomTextField.h"
#define kLeftViewSpace 10
@implementation CustomTextField

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}
-(CGRect)leftViewRectForBounds:(CGRect)bounds
{
    CGRect rect=[super leftViewRectForBounds:bounds];
//    rect.origin.x=kLeftViewX;
//    rect.origin.y=(self.size.height-kLeftViewWidth)/2;
//    rect.size=CGSizeMake(kLeftViewWidth, kLeftViewWidth);
    return rect;
}
-(CGRect)placeholderRectForBounds:(CGRect)bounds
{
    CGRect rect=[super placeholderRectForBounds:bounds];
     rect.origin.x=CGRectGetMaxX(self.leftView.frame)+kLeftViewSpace;
    //iconRect.origin.y=12;
    //iconRect.size=CGSizeMake(26, 26);
    return rect;
}
//光标位置
- (CGRect)editingRectForBounds:(CGRect)bounds
{
    CGRect rect=[super editingRectForBounds:bounds];
    rect.origin.x=CGRectGetMaxX(self.leftView.frame)+kLeftViewSpace;
    //iconRect.origin.y=12;
    //iconRect.size=CGSizeMake(26, 26);
    return rect;
}
//文本输入位置
- (CGRect)textRectForBounds:(CGRect)bounds
{
    CGRect rect=[super editingRectForBounds:bounds];
     rect.origin.x=CGRectGetMaxX(self.leftView.frame)+kLeftViewSpace;
    //iconRect.origin.y=12;
    //iconRect.size=CGSizeMake(26, 26);
    return rect;

}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
